package com.example.shopdemo.dto;

import lombok.Data;

/**
 * @author ：Anitaxiaofeng
 * @description：
 * @create 2018-01-21
 **/
@Data
public class Result<T> {

    private boolean success;  //是否成功标志
    private T data; //成功返回的数据
    private String errorMsg; //错误信息
    private int errorCode;
    public Result(){}


    //成功时的构造器
    public Result(boolean success,T data){
        this.success = success;
        this.data = data;
    }

    //错误时的构造器
    public Result(boolean success,int errorCode,String errorMsg){
        this.success = success;
        this.errorCode = errorCode;
        this.errorMsg = errorMsg;
    }


}
